﻿<Window
    x:Class="TimelineLibrary.EventDetailsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:TimelineLibrary"
    Title="{Binding Path=Event.Title, Mode=OneWay}"
    WindowStyle="SingleBorderWindow"
    Width="450"
    Height="350">
    
    <Window.Resources>
        
        <local:NullToUnsetConverter
            x:Key="NullToUnsetConverter"></local:NullToUnsetConverter>
        
    </Window.Resources>
    
    <Grid
        x:Name="LayoutRoot"
        Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition
                Height="Auto" />
            <RowDefinition
                Height="26" />
        </Grid.RowDefinitions>

        <ScrollViewer
            Grid.Row="0"
            Height="285"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top">

            <StackPanel
                VerticalAlignment="Stretch"
                Orientation="Vertical"
                HorizontalAlignment="Stretch">

                <Image
                    x:Name="EventImage"
                    Source="{Binding Path=Event.EventImage, Converter={StaticResource NullToUnsetConverter}, Mode=OneWay}"
                    VerticalAlignment="Center"
                    Width="Auto"
                    Stretch="None"
                    Margin="5"
                    HorizontalAlignment="Left" />

                <TextBlock
                    HorizontalAlignment="Stretch"
                    TextWrapping="Wrap"
                    Text="{Binding Path=Event.Description, Mode=OneWay}" />

                <TextBlock
                    HorizontalAlignment="Stretch">
                    <LineBreak />
                </TextBlock>

                <local:Hyperlink
                    Click="OnHyperlinkButtonClick"
                    Width="Auto"
                    Visibility="{Binding LinkVisibility}"
                    HorizontalAlignment="Left"
                    Content="{Binding Path=Event.Link, Mode=OneWay}" />

            </StackPanel>

        </ScrollViewer>

        <Button
            x:Name="OKButton"
            Content="OK"
            Click="OnOkClick"
            Width="70"
            Height="23"
            HorizontalAlignment="Right"
            Margin="0,3,0,0"
            Grid.Row="1" />
    </Grid>
</Window>
